package com.yerbe.web.user.service_impl;

import com.yerbe.web.user.mapper.UserMapper;
import com.yerbe.web.user.model.UserModel;
import com.yerbe.web.user.service.UserService;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    private final UserMapper userMapper;

    public UserServiceImpl(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public UserModel findUserByPhone(String phone) {
        return userMapper.findUserByPhone(phone);
    }

    @Override
    public int newUser(String name, String phone, String password) {
        return userMapper.insert(name, phone, password);
    }
}
